

**************************************
***********FACTOR ANALYSIS************
***********POPULISM INDEX*************
**************************************

clear all
*cd "" set working directory
use "goodpolitician.dta"



*POPULISM W1
recode P10A_W1 ///
P10B_W1 ///
P10C_W1 ///
P10D_W1 ///
P10E_W1 ///
P10F_W1 (98 99=.)

factor P10A_W1 P10B_W1 P10C_W1 P10D_W1 P10E_W1 P10F_W1, mineigen(1)  

*INDEX INCLUDED IN THE DATASET
*predict populism1
*summarize populism1, detail

*gen popmedian1=0 if populism1<.0847382 
*replace popmedian1=1 if populism1>=.0847382 
*replace popmedian1=. if populism1==.

*POPULISM W2
recode P10A_W2 ///
P10B_W2 ///
P10C_W2 ///
P10D_W2 ///
P10E_W2 ///
P10F_W2 (98 99=.)

factor P10A_W2 P10B_W2 P10C_W2 P10D_W2 P10E_W2 P10F_W2, mineigen(1)  

*INDEX INCLUDED IN THE DATASET
*predict populism2
*summarize populism2, detail

*gen popmedian2=0 if populism2<.0235028 
*replace popmedian2=1 if populism2>=.0235028
*replace popmedian2=. if populism2==.
